package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.CarType;
import com.xmtlxx.tms.domain.bo.CarTypeBo;
import com.xmtlxx.tms.domain.vo.CarTypeVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 车型Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface CarTypeMapper extends BaseMapperPlus<CarTypeMapper, CarType, CarTypeVo> {
    /**
     * 根据条件分页查询车型
     *
     * @param carType 车型
     * @return Page CarType
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    Page<CarTypeVo> selectPageCarTypeList(@Param("page") Page<CarType> page,@Param("carType") CarTypeBo carType);

    /**
     * 查询车型列表
     *
     * @param carType 车型
     * @return 车型集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "c.create_by"),
        @DataColumn(key = "deptName", value = "c.dept_id"),
        @DataColumn(key = "userName", value = "c.create_by")
    })
    List<CarTypeVo> selectCarTypeList(@Param("carType") CarTypeBo carType);

    CarTypeVo selectCarTypeVoByID(String id);
}
